/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.pacis.shca.domain.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author solriver
 */
@Entity
@Table(name = "visita_domiciliaria", catalog = "bdshca")
@NamedQueries({
    @NamedQuery(name = "VisitaDomiciliaria.findAll", query = "SELECT v FROM VisitaDomiciliaria v"),
    @NamedQuery(name = "VisitaDomiciliaria.findByIdVisitaDomiciliaria", query = "SELECT v FROM VisitaDomiciliaria v WHERE v.idVisitaDomiciliaria = :idVisitaDomiciliaria"),
    @NamedQuery(name = "VisitaDomiciliaria.findByVisFecha", query = "SELECT v FROM VisitaDomiciliaria v WHERE v.visFecha = :visFecha"),
    @NamedQuery(name = "VisitaDomiciliaria.findByVisResultado", query = "SELECT v FROM VisitaDomiciliaria v WHERE v.visResultado = :visResultado"),
    @NamedQuery(name = "VisitaDomiciliaria.findByVisProximaVisita", query = "SELECT v FROM VisitaDomiciliaria v WHERE v.visProximaVisita = :visProximaVisita"),
    @NamedQuery(name = "VisitaDomiciliaria.findByVisProblemaComunidad", query = "SELECT v FROM VisitaDomiciliaria v WHERE v.visProblemaComunidad = :visProblemaComunidad"),
    @NamedQuery(name = "VisitaDomiciliaria.findByVisRiesgoCaida", query = "SELECT v FROM VisitaDomiciliaria v WHERE v.visRiesgoCaida = :visRiesgoCaida"),
    @NamedQuery(name = "VisitaDomiciliaria.findByVisRiesgoCaidaDescripcion", query = "SELECT v FROM VisitaDomiciliaria v WHERE v.visRiesgoCaidaDescripcion = :visRiesgoCaidaDescripcion"),
    @NamedQuery(name = "VisitaDomiciliaria.findByVisResultadoPuntaje", query = "SELECT v FROM VisitaDomiciliaria v WHERE v.visResultadoPuntaje = :visResultadoPuntaje"),
    @NamedQuery(name = "VisitaDomiciliaria.findByVisObservaciones", query = "SELECT v FROM VisitaDomiciliaria v WHERE v.visObservaciones = :visObservaciones"),
    @NamedQuery(name = "VisitaDomiciliaria.findByVisApoyoFamilia", query = "SELECT v FROM VisitaDomiciliaria v WHERE v.visApoyoFamilia = :visApoyoFamilia")})
public class HomeVisit implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_visita_domiciliaria")
    private Integer id;
    @Column(name = "vis_fecha")
    @Temporal(TemporalType.DATE)
    private Date date;
    @Column(name = "vis_resultado")
    private Short result;
    @Column(name = "vis_proxima_visita")
    @Temporal(TemporalType.DATE)
    private Date nextVisit;
    @Column(name = "vis_problema_comunidad")
    private String communityProblems;
    @Column(name = "vis_riesgo_caida")
    private Boolean fallingRisk;
    @Column(name = "vis_riesgo_caida_descripcion")
    private String fallingRiskDescription;
    @Column(name = "vis_resultado_puntaje")
    private Integer score;
    @Column(name = "vis_observaciones")
    private String observations;
    @Column(name = "vis_apoyo_familia")
    private String familySupport;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "visIdVisitaDomiciliaria")
    private List<MedicalAssurance> medicalAssurances;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "visIdVisitaDomiciliaria")
    private List<SocioEconomicData> socioEconomicData;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "visIdVisitaDomiciliaria")
    private List<FamilyRisk> familyRisks;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "visIdVisitaDomiciliaria")
    private List<HealthObservation> healthObservations;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "visIdVisitaDomiciliaria")
    private List<Instruction> instructions;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "visIdVisitaDomiciliaria")
    private List<Occupation> occupations;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "visIdVisitaDomiciliaria")
    private List<HousingEnvironmentData> housingEnvironmentData;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "visIdVisitaDomiciliaria")
    private List<ResidenceRecord> residenceRecords;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "visIdVisitaDomiciliaria")
    private List<FamilyPackage> familyPackages;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "visIdVisitaDomiciliaria")
    private List<GroupRecord> groupRecords;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "visIdVisitaDomiciliaria")
    private Tracking tracking;
    @JoinColumn(name = "ten_id_tenencia_animal", referencedColumnName = "id_tenencia_animal")
    @ManyToOne(optional = false)
    private AnimalPossession animalPossession;
    @JoinColumn(name = "fic_id_ficha_familiar", referencedColumnName = "id_ficha_familiar")
    @ManyToOne
    private FamilyRecord familyRecord;

    public HomeVisit() {
    }

    public HomeVisit(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Short getResult() {
        return result;
    }

    public void setResult(Short result) {
        this.result = result;
    }

    public Date getNextVisit() {
        return nextVisit;
    }

    public void setNextVisit(Date nextVisit) {
        this.nextVisit = nextVisit;
    }

    public String getCommunityProblems() {
        return communityProblems;
    }

    public void setCommunityProblems(String communityProblems) {
        this.communityProblems = communityProblems;
    }

    public Boolean getFallingRisk() {
        return fallingRisk;
    }

    public void setFallingRisk(Boolean fallingRisk) {
        this.fallingRisk = fallingRisk;
    }

    public String getfallingRiskDescription() {
        return fallingRiskDescription;
    }

    public void setfallingRiskDescription(String fallingRiskDescription) {
        this.fallingRiskDescription = fallingRiskDescription;
    }

    public Integer getScore() {
        return score;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    public String getObservations() {
        return observations;
    }

    public void setObservations(String observations) {
        this.observations = observations;
    }

    public String getFamilySupport() {
        return familySupport;
    }

    public void setFamilySupport(String familySupport) {
        this.familySupport = familySupport;
    }

    public List<MedicalAssurance> getMedicalAssurances() {
        return medicalAssurances;
    }

    public void setMedicalAssurances(List<MedicalAssurance> medicalAssurances) {
        this.medicalAssurances = medicalAssurances;
    }

    public List<SocioEconomicData> getSocioEconomicData() {
        return socioEconomicData;
    }

    public void setSocioEconomicData(List<SocioEconomicData> socioEconomicData) {
        this.socioEconomicData = socioEconomicData;
    }

    public List<FamilyRisk> getFamilyRisks() {
        return familyRisks;
    }

    public void setFamilyRisks(List<FamilyRisk> familyRisks) {
        this.familyRisks = familyRisks;
    }

    public List<HealthObservation> getHealthObservationList() {
        return healthObservations;
    }

    public void setHealthObservations(List<HealthObservation> healthObservations) {
        this.healthObservations = healthObservations;
    }

    public List<Instruction> getInstructions() {
        return instructions;
    }

    public void setInstructions(List<Instruction> instructions) {
        this.instructions = instructions;
    }

    public List<Occupation> getOccupations() {
        return occupations;
    }

    public void setOccupations(List<Occupation> occupations) {
        this.occupations = occupations;
    }

    public List<HousingEnvironmentData> getDatoViviendaEntornoList() {
        return housingEnvironmentData;
    }

    public void setDatoViviendaEntornoList(List<HousingEnvironmentData> datoViviendaEntornoList) {
        this.housingEnvironmentData = datoViviendaEntornoList;
    }

    public List<ResidenceRecord> getResidenceRecords() {
        return residenceRecords;
    }

    public void setResidenceRecords(List<ResidenceRecord> residenceRecords) {
        this.residenceRecords = residenceRecords;
    }

    public List<FamilyPackage> getFamilyPackages() {
        return familyPackages;
    }

    public void setFamilyPackages(List<FamilyPackage> familyPackages) {
        this.familyPackages = familyPackages;
    }

    public List<GroupRecord> getGroupRecords() {
        return groupRecords;
    }

    public void setGroupRecords(List<GroupRecord> groupRecords) {
        this.groupRecords = groupRecords;
    }

    public Tracking getTracking() {
        return tracking;
    }

    public void setTracking(Tracking tracking) {
        this.tracking = tracking;
    }

    public AnimalPossession getAnimalPossession() {
        return animalPossession;
    }

    public void setAnimalPossession(AnimalPossession animalPossession) {
        this.animalPossession = animalPossession;
    }

    public FamilyRecord getFamilyRecord() {
        return familyRecord;
    }

    public void setFamilyRecord(FamilyRecord familyRecord) {
        this.familyRecord = familyRecord;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HomeVisit)) {
            return false;
        }
        HomeVisit other = (HomeVisit) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.pacis.shca.domain.entity.HomeVisit[ id=" + id + " ]";
    }
    
}
